<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "sms_log".
 *
 * @property integer $sms_log_id
 * @property string $mobile
 * @property string $verify_code
 * @property string $sign_name
 * @property string $template_code
 * @property string $operation_type
 * @property integer $status
 * @property string $err_msg
 * @property integer $create_time
 * @property integer $is_used
 * @property integer $use_time
 */
class SmsLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sms_log';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['mobile', 'sign_name', 'template_code', 'create_time'], 'required'],
            [['operation_type'], 'string'],
            [['status', 'create_time', 'is_used', 'use_time'], 'integer'],
            [['mobile', 'sign_name', 'template_code'], 'string', 'max' => 20],
            [['verify_code'], 'string', 'max' => 6],
            [['err_msg'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'sms_log_id' => '短信记录ID',
            'mobile' => '手机号码',
            'verify_code' => '短信验证码',
            'sign_name' => '签名',
            'template_code' => '模板名称',
            'operation_type' => '操作类型',
            'status' => '短信发送状态，1成功，0失败',
            'err_msg' => '错误消息',
            'create_time' => '发送时间',
            'is_used' => '是否已使用',
            'use_time' => '使用时间',
        ];
    }
}
